package mapstruct;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface DoctorMapper {
    DoctorMapper INSTANCE = Mappers.getMapper(DoctorMapper.class);

    //不同字段映射
    @Mapping(source="doctor.specialty",target="specialization")
    //多个源对象到DTO
    @Mapping(source = "education.degreeName", target = "degree")
    DoctorDto toDto(Doctor doctor,Education education);
}